package com.sigleton.mode;

/**
 * 单例模式-懒汉模式-多线程获取
 *
 * @author zyangb
 */
public class SlackerModelThreadEntity {
    /**
     * 创建私有化的实例对象
     */
    private static SlackerModelThreadEntity starvingModelThreadEntity = null;

    /**
     * 封装构造方法，使外部不能实例化对象
     */
    private SlackerModelThreadEntity() {

    }

    /**
     * 提供让外部调用实例对象的方法
     *
     * @return 返回私有实力对象 starvingModelEntity
     */
    public static SlackerModelThreadEntity StarvingModelThreadEntity() {
        if (starvingModelThreadEntity == null) {
            synchronized (SlackerModelThreadEntity.class) {
                if (starvingModelThreadEntity == null) {
                    starvingModelThreadEntity = new SlackerModelThreadEntity();
                }
            }
        }
        return starvingModelThreadEntity;
    }
}
